package zjt.IO1;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class dmeo8 {
    public static void main(String[] args)throws Exception {
        ObjectOutputStream objectOutputStream =
                new ObjectOutputStream(new FileOutputStream("c:\\b.txt"));
        //2.序列化数据到磁盘
        objectOutputStream.writeObject("hello");

        //3.创建反序列化对象
        ObjectInputStream objectInputStream =
                new ObjectInputStream(new FileInputStream("c:\\b.txt"));
        //4.反序列化
        Object readUTF = objectInputStream.readObject();
        System.out.println(readUTF);
    }
}
